home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / internet-tools / ipdial / examples / hangup.ipdial next >
Encoding:
Text File  |  1996-04-16  |  1.7 KB  |  67 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;
  3. ;   Example IPDial 2.1 dial script for terminating a connection
  4. ;   $VER: Hangup.IPDial 2.1 (16.04.96)
  5. ;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7. ;
  8. ;   The line below *must* be present and *must* be the first command
  9. ;   line in the script if you don't use the command line option SANADEV.
  10. ;   It specifies the device, unit, baudrate and the protocol to use (7WIRE,
  11. ;   XONXOFF or NONE). You may omit the unit, baudrate and protocol, in which
  12. ;   case the defaults are used (see manual).
  13. ;
  14. ;   Be sure, that the parameters you are using in this script are the
  15. ;   same as used for initializing AmiTCP/IP (or use SANADEV)!
  16.  
  17.     DEVICE serial.device UNIT=0 BAUD=38400 7WIRE
  18.  
  19.  
  20. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  21. ;
  22. ;   Check if modem is in command or online mode
  23.  
  24.     SEND "\r\n"
  25.     DELAY 1
  26.     SEND "ATZ\r"
  27.     WAIT TIMEOUT=2 "OK"
  28.     ON STATUS GOTO CmdMode Hangup
  29.  
  30.  
  31. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  32. ;
  33. ;   Modem is in online mode. "+++" will enter command mode
  34.  
  35. CmdMode:
  36.     SEND "+"
  37.     DELAY 0 100
  38.     SEND "+"
  39.     DELAY 0 100
  40.     SEND "+"
  41.     WAIT TIMEOUT=3 "NO CARRIER" "OK"
  42.     ON STATUS GOTO TIMEOUT
  43.  
  44.  
  45. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  46. ;
  47. ;   Now tell the modem to disconnect
  48.  
  49. Hangup:
  50.     DELAY 1
  51.     SEND "ATH0\r"
  52.     WAIT "NO CARRIER" "OK"
  53.     ON STATUS GOTO TIMEOUT
  54.  
  55.     ECHO "Disconnected.\n"
  56.     EXIT 0
  57.  
  58. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  59. ;
  60. ;   Error message: Timeout
  61.  
  62. TIMEOUT:
  63.     ECHO "\nTimeout. Entering terminal mode.\n"
  64.     TERMINAL NOECHO RAW
  65.     EXIT 0
  66.  
  67.